﻿
package extremefx.browser {
	import flash.external.ExternalInterface;

	/**
	 * @author Marcelo Volmaro
	 */
	public final class ResizeFlash {
		public static function setSize(pW:uint = 0, pH:uint = 0):void {
			var id:String = BrowserUtils.getObjectId();
			if (id) ExternalInterface.call(_setFlashSize, id, pW, pH);
		}
		
		private static var _setFlashSize:XML = <script><![CDATA[
function (_id, _w, _h) {
	var f = document.getElementById(_id);
	if (f && _w) {
		f.style.width = f.style.minWidth = _w;
		f.setAttribute("width", _w);
	}
	
	if (f && _h) {
		f.style.height = f.style.minHeight = _h;
		f.setAttribute("height", _h);
	}
}
]]></script>;
	}
}
